package tehMod;

import java.util.Iterator;
import java.util.Set;

import tehUtils.BlockFinder;

import net.minecraft.src.forge.*;
import net.minecraft.src.*;

public class ItemBanner extends Item implements ITextureProvider {
	
	public static final String itemName = "Banner";
	public static final String displayName = "Banner";

	public ItemBanner(int id) {
		super(id);
		setItemName(itemName);
		setIconIndex(0);
		
		ModLoader.AddName(this, displayName);
//		setIconIndex(ModLoader.addOverride("/gui/items.png", "/banner.png"));
		ModLoader.AddRecipe(new ItemStack(this, 1), new Object[] {
			"SPP",
			"SPP",
			"S  ",
			'S', Item.stick,
			'P', Item.paper
		});
	}
	
	public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int i, int j, int k, int l) {
		if (mod_TehMod.bannerBlock.canPlaceBlockAt(world, i, j + 1, k)) {
			TileEntityBanner banner = new TileEntityBanner();
			world.setBlockWithNotify(i, j + 1, k, mod_TehMod.bannerBlock.blockID);
			entityplayer.inventory.consumeInventoryItem(0);
			return true;
		} else {
			return false;
		}
	}
	
    public boolean isFull3D()
    {
        return true;
    }
    
    public String getTextureFile() {
    	return mod_TehMod.itemTexture;
    }

}
